package com.forur.stubootstarter4.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.forur.stubootstarter4.entity.UserOrder;
import com.forur.stubootstarter4.mapper.UserOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserOrderServiceImpl implements UserOrderService{

    @Autowired
    private UserOrderMapper userOrderMapper;
    @Override
    public void add(String yearmonth) {
        UserOrder userOrder = new UserOrder();
        userOrder.setYearmonth(yearmonth);
        userOrderMapper.insert(userOrder);
    }

    @Override
    public void find(String yearmonth) {
        QueryWrapper<UserOrder> userOrderQueryWrapper = new QueryWrapper<>();
        userOrderQueryWrapper.eq("yearmonth", yearmonth);
        List<UserOrder> userOrderList = userOrderMapper.selectList(userOrderQueryWrapper);
        System.out.println("pppp==" + userOrderList);

    }
}
